<template>
  <div id="add-cater-merchants" class="route-page">
    <!-- <div class="container"> -->
    <div style="    display: flex;
    justify-content: center;margin:10px">
      <span style="font-size:20px； ">申请记录</span>
    </div>
    <el-table :data="tableData" stripe style="width: 100%" border v-loading="loading"
      :header-cell-style="{ background: '#ebecf0', color: '#606266' }">
      <!-- <el-table-column prop="reviewUser" label="审核人" width="180"></el-table-column> -->
      <el-table-column prop="reviewStatus" label="审核状态" width="180" align="center">
        <template slot-scope="scope">
          <span v-if="scope.row.reviewStatus === 1">已提交</span>
          <span v-if="scope.row.reviewStatus === 2">初审通过</span>
          <span v-if="scope.row.reviewStatus === 3">初审不通过</span>
          <span v-if="scope.row.reviewStatus === 4">复审不通过</span>
          <span v-if="scope.row.reviewStatus === 5">复审通过</span>
          <span v-if="scope.row.reviewStatus === 6">银行审核中</span>
          <span v-if="scope.row.reviewStatus === 7">银行审核通过</span>
          <span v-if="scope.row.reviewStatus === 8">银行审核不通过</span>
        </template>
      </el-table-column>
      <el-table-column prop="reviewOption" label="审核意见" align="center"></el-table-column>
      <el-table-column prop="reviewTime" label="审核时间" align="center"></el-table-column>
      <!-- <el-table-column label="操作" width="200" align="center" fixed="right">
        <template slot-scope="scope">
          <el-button
            size="mini"
            @click="editdetailshop(scope.row)"
            type="text"
            v-if="scope.row.reviewStatus===3"
          >点击修改</el-button>
          <el-button size="mini" @click="seedetailshop(scope.row)" type="text">查看详情</el-button>
        </template>
      </el-table-column>-->
    </el-table>

    <div style="display: flex;justify-content: center;margin: 30px 10px 10px;">
      <span style="font-size:20px； ">工商信息变更申请记录</span>
    </div>

    <el-table :data="changeTableList" stripe style="width: 100%" border v-loading="loading"
      :header-cell-style="{ background: '#ebecf0', color: '#606266' }">
      <el-table-column prop="reviewStatus" label="审核状态" width="180" align="center">
        <template slot-scope="scope">
          <span v-if="scope.row.reviewStatus === 1">已提交</span>
          <span v-if="scope.row.reviewStatus === 2">初审通过</span>
          <span v-if="scope.row.reviewStatus === 3">初审不通过</span>
          <span v-if="scope.row.reviewStatus === 4">复审不通过</span>
          <span v-if="scope.row.reviewStatus === 5">复审通过</span>
          <span v-if="scope.row.reviewStatus === 6">银行审核中</span>
          <span v-if="scope.row.reviewStatus === 7">银行审核通过</span>
          <span v-if="scope.row.reviewStatus === 8">银行审核不通过</span>
        </template>
      </el-table-column>
      <el-table-column prop="reviewOption" label="审核意见" align="center"></el-table-column>
      <el-table-column prop="reviewTime" label="审核时间" align="center"></el-table-column>
    </el-table>

    <!-- </div> -->
    <!-- <el-steps :active="active" align-center title="审核示例">
      <el-step title="已提交" description="您的申请已提交，请等待大区审核。"></el-step>
      <el-step title="初审通过" description="大区审核已通过，请等待总部审核。"></el-step>
      <el-step title="复审" description="总部审核已通过，您的店铺申请已完成。"></el-step>
      <el-step title="完成" description="您的店铺申请已完成,请确认是否收到短信信息。"></el-step>
    </el-steps>-->
    <!-- <el-steps :space="200" :active="active" finish-status="success">
      <div>您当前的状态：</div>
      <el-step :title="title"></el-step>
    </el-steps>-->
    <el-button type="primary" size="small" style="    margin-left: 408px;
    margin-top: 10px;
" @click="goshouye()">返回</el-button>
  </div>
</template>

<script>
import { queryReviewInfo } from '@/api/addShopapply';
import { getReviewId } from '@/api/loginApi';
export default {
  data() {
    return {
      active: '4',
      title: '',
      anthCode: '',
      active: '2',
      tableData: [],
      form: {},
      loading: true,

      changeTableList: [],
      changeLoading: true
    };
  },

  computed: {},
  mounted() {
    console.log(this.$route.params.v, 'llll');
    if (this.$route.params.flagcode) {
      localStorage.setItem(
        'userReviewRecordList',
        JSON.stringify(this.$route.params.v.userReviewRecordList)
      );
      localStorage.setItem('authCode', this.$route.params.v.authCode);
    }

    this.userReviewRecordList = localStorage.getItem('userReviewRecordList');
    // this.tableData = JSON.parse(this.userReviewRecordList);
    // console.log(this.tableData, "llll555");
    this.getReviewId();
    // var active = 3;
    // switch (active) {
    //   case 1:
    //     this.title = "已提交";
    //     break;
    //   case 2:
    //     this.title = "初审通过";
    //     break;
    //   case 3:
    //     this.title = "初审不通过";
    //     break;
    //   case 4:
    //     this.title = "复审不通过";
    //     break;
    //   case 5:
    //     this.title = "复审通过";
    //     break;
    // }
    // this.shopAuthdetail();
  },

  methods: {
    goshouye() {
      this.$router.push('/shopArchives');
    },
    seedetailshop(v) {
      console.log(v, 'kk');
      let data = { uuid: v.reviewId };
      queryReviewInfo(data).then((res) => {
        this.$router.push({
          name: 'addshopapplydetailcopy',
          params: {
            v: res.result,
            flagaddshop: false,
            flagfan: false,
          },
        });
      });
    },
    getReviewId() {
      //   this.authCode = localStorage.getItem("authCode");
      this.$route.params.v.authCode ? getReviewId({ reviewId: this.$route.params.v.authCode }).then((res) => {
        this.tableData = res.result.userReviewRecordList;
        this.changeTableList = res.result.userReviewRecordListbank;

        // this.$router.push({
        //   name: "addshopapplydetail",
        //   params: {
        //     v: res.result,
        //     flagaddshop: false
        //   }
        // });
      }).finally(() => {
        this.loading = false;
      }) : (this.loading = false);

      // this.$route.params.v.businessChangeReviewId ? getReviewId({ reviewId: this.$route.params.v.businessChangeReviewId }).then((res) => {
      //   this.changeTableList = res.result.userReviewRecordList;
      // }).finally(() => {
      //   this.changeLoading = false
      // }) : (this.changeLoading = false);
    },
    editdetailshop(v) {
      console.log(v, 'kk');
      let data = { uuid: v.reviewId };
      queryReviewInfo(data).then((res) => {
        this.$router.push({
          name: 'addshopapplydetail',
          params: {
            v: res.result,
            flagaddshop: true,
            restedit: true,
            flagdianji: false,
          },
        });
      });
    },
  },
};
</script>

<style lang="scss" scoped>
#add-cater-merchants {
  h2 {
    font-size: 24px;
    font-weight: 700;
    padding-top: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgb(230, 231, 235);
  }

  .container {
    margin-top: 10px;
  }

  .el-input--medium .el-input__inner {
    height: auto !important;
  }

  .idcard {
    display: flex;
  }

  .idcard div {
    margin: 10px;
  }

  .bussLicPhoto {
    display: flex;
  }

  .bussLicPhoto div {
    margin: 5px;
    text-align: center;
  }
}

#add-cater-merchants.route-page {
  background: #fff;
  width: 70%;
  padding: 3% 0;
  margin: 0 auto;
  //   border: 2px #ccc dashed;
  margin-top: 2%;
}
</style>
